package Service;


import Data.event;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

public class SendMassage {
    private static Socket socket;

    public static Socket getSocket() {
        return socket;
    }

    public synchronized static void setSocket(Socket socket) {
        SendMassage.socket = socket;
    }

    public SendMassage() {
    }

    public synchronized void sendMassage(event massage) throws IOException {
        ObjectOutputStream writer=new ObjectOutputStream(socket.getOutputStream());
        writer.writeObject(massage);
        writer.flush();
    }
}
